UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'pHScUPM7VZwkI1XwsevQY2cCeQ5fcJiE/QnFEwW4t60='
WHERE
key_id = 'a1957c580c6cbfa8f8b905729df9fa2b3b8bb6af7d02e587289dc8707b00e8b7'
AND (
token = 'pHScUPM7VZwkI1XwsevQY2cCeQ5fcJiE/QnFEwW4t60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)