UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '4WJR3lzzVQsJRWWoqM6KhYpkQWJxukrfpfRwtI2dmTE='
WHERE
key_id = '15067e8d943839839f523e4bc8f19bda9ef084fcb118041bf92704d380ede3d7'
AND (
token = '4WJR3lzzVQsJRWWoqM6KhYpkQWJxukrfpfRwtI2dmTE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)