UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'InmgmAMcxjfXNLglLXXq4wQzoRL4Ch4g7ZKmz946q/Q='
WHERE
key_id = '0dcac201da68cf3a23b1d8c0b514ca25845ef5f06f286d58ec162ee36f986339'
AND (
token = 'InmgmAMcxjfXNLglLXXq4wQzoRL4Ch4g7ZKmz946q/Q='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)