UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'vTT/BeMxJWYUgW5WzyV9T8eSgrQrxY7zA1wkUgRQDwA=' 
WHERE 
  key_id = 'bf2e597864575662a7df6aca3e2cc22d1441ecf9e6e767a40cc0fd4e0cad9a7b' 
  AND (
    token = 'vTT/BeMxJWYUgW5WzyV9T8eSgrQrxY7zA1wkUgRQDwA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00060