UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'drXCkOTM+WDWV8Ku/l8KI8Kfa7TaJdSnp/8s482Jc28='
WHERE
key_id = '58e74dd71ebff45584f70451394731f7306e5d041ce862f837b646b844d2f4d9'
AND (
token = 'drXCkOTM+WDWV8Ku/l8KI8Kfa7TaJdSnp/8s482Jc28='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)