UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '/cPHkZvlFXA4M8knQBp5fAbQY8NUvmq1eLoyscnsNKY=' 
WHERE 
  key_id = '995fd8735eee314ed7dac71d6e521ce31573fec6a8fdf89e954e4515bea2d492' 
  AND (
    token = '/cPHkZvlFXA4M8knQBp5fAbQY8NUvmq1eLoyscnsNKY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041