UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FUfMCMSvq5VzFnO3U01HijqC+EQczrvEtZ6qoKn303I='
WHERE
key_id = 'a5d8e062e225895b1ca9cc6a2a0098e2df019d5bc27cd2932c22f0e6ad45ed0d'
AND (
token = 'FUfMCMSvq5VzFnO3U01HijqC+EQczrvEtZ6qoKn303I='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)