UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'paoaK8qC84kbDUHKwvngpGxZms7GM0kcQQT3zCg/mSQ=' 
WHERE 
  key_id = '905d19e7f8ace3331e1df66610daa41321582820ec952667bf0559801213157d' 
  AND (
    token = 'paoaK8qC84kbDUHKwvngpGxZms7GM0kcQQT3zCg/mSQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00049