UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'Xtyo5Hl8zltS307kUMV6qWpsMPZ8XJ/NFEFjhQUvjTQ=' 
WHERE 
  key_id = '7841dfbae93e30cdef015ba8792dd213af3c7ff912602a9931bd24357651138b' 
  AND (
    token = 'Xtyo5Hl8zltS307kUMV6qWpsMPZ8XJ/NFEFjhQUvjTQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041