UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4SEByq1n4K9N/IflL93PN9UE6ULkL3k4j9ZzE1M3EcU='
WHERE
key_id = 'd47719c6ccfc7bf24eaae44f434d93ea4b91e17dfca95d7ca46d7cffe4ede95f'
AND (
token = '4SEByq1n4K9N/IflL93PN9UE6ULkL3k4j9ZzE1M3EcU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)