UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'HPzdYo5OfTaYILRCnSX+pOIZKXXSkRpJmlI8mSDGEFw=' 
WHERE 
  key_id = '37ef2d16a8d35da6fa50e5a5355658497d3d6e3a739a1555cb74b5c7fee580f2' 
  AND (
    token = 'HPzdYo5OfTaYILRCnSX+pOIZKXXSkRpJmlI8mSDGEFw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00025