UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'LO6orIkCq6lfPtpaJWQ/YlMyQ+y34tEsZDc8eDwf/Zg='
WHERE
key_id = 'd9496f3f212d613fb86b02e2f774a6a04487af107f00d16284c17a32c0f9ab25'
AND (
token = 'LO6orIkCq6lfPtpaJWQ/YlMyQ+y34tEsZDc8eDwf/Zg='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)