UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ePQo5iP6ifj0vbNu/56OjFmZ2qBWsq/shrsEwDIUL5Y='
WHERE
key_id = '1c33e0f8ded1d33a30d4158609d59a5d28f362894a767dd63a712197c6336c34'
AND (
token = 'ePQo5iP6ifj0vbNu/56OjFmZ2qBWsq/shrsEwDIUL5Y='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)