UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'oJIHZjkIfM2IaZtCmZZ5RVrIRT+Up6Qo6KSlHuD+T/c=' 
WHERE 
  key_id = 'b942da76a1518df49ca1b86255ccfca2e9006e610a2bd5cfd319e4c3434f88ef' 
  AND (
    token = 'oJIHZjkIfM2IaZtCmZZ5RVrIRT+Up6Qo6KSlHuD+T/c=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00059