UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'sc6/FFmFl0EXNiHaGVTM5VhphjM+jk+wUQYFFEarYHE=' 
WHERE 
  key_id = '5c44a05d030c6692adea886e886f9d1fce963d3cd27be1c93b129891bc0d5e68' 
  AND (
    token = 'sc6/FFmFl0EXNiHaGVTM5VhphjM+jk+wUQYFFEarYHE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029