UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'kVcmEafWrLgynxIlmWi+ibRVbn+hOzywPKPacVcZGUc='
WHERE
key_id = '2cd00cb8caf723928ddb79250d2d526c048a87c14ee3ca0451f73ae14456d559'
AND (
token = 'kVcmEafWrLgynxIlmWi+ibRVbn+hOzywPKPacVcZGUc='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)