UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yrCnIplnRhMv6cpf3mRL+2SpBqc6VCbh6x+8vdbwnfU='
WHERE
key_id = 'cc6c9989d849856d375042293bed58d52af8cb24e0c66081bf30d14a4573852f'
AND (
token = 'yrCnIplnRhMv6cpf3mRL+2SpBqc6VCbh6x+8vdbwnfU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)