UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'uqCqNmJgfvn0/Bxq2vamyKY31oqKqLuuXX2Nwbso2Ec=' 
WHERE 
  key_id = 'fe49b6a15254facd313e4fa07614756771d52f3630e01264443c9c2862d2b5e0' 
  AND (
    token = 'uqCqNmJgfvn0/Bxq2vamyKY31oqKqLuuXX2Nwbso2Ec=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00021