UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'K0o/ZqtDpxooVEoxSySK+iXq7bqaxcHQrp33eG3YDoI=' 
WHERE 
  key_id = 'b14640b1a487ddf8a38f48f06f89ec4f41cb29e012aeeb005df2ff1e13fa72ee' 
  AND (
    token = 'K0o/ZqtDpxooVEoxSySK+iXq7bqaxcHQrp33eG3YDoI=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030