UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jf+5oz9XknS/cKl6Pnz3zKcYq1+zS6Mv6n9TeEB1J24='
WHERE
key_id = '150f003aa9f84c0ae4418f046f580b9cf1afb757b4886d8232b9bfc28f4117e0'
AND (
token = 'jf+5oz9XknS/cKl6Pnz3zKcYq1+zS6Mv6n9TeEB1J24='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)