UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XCnhexOhdyMQzQDSfioW9etRYCuQsHy/3O84O/sERiQ='
WHERE
key_id = 'c9448901ff3ce4ac5c0a782ee35ed65656ed4d611488a7e0d07c7cf5820981ad'
AND (
token = 'XCnhexOhdyMQzQDSfioW9etRYCuQsHy/3O84O/sERiQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)