UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'POW/JlcJY+VVfngi9/iyei4FuYvrbNASi06kaMWAcp4=' 
WHERE 
  key_id = '56b59b24b5fdd536f54be67713ff9437c12aa58b7bc8cb1af5917cc54755f50d' 
  AND (
    token = 'POW/JlcJY+VVfngi9/iyei4FuYvrbNASi06kaMWAcp4=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00044