UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/9+h1WwZ2pw23NZPSkNfOlqDrdfIoB2SDOKPj9XA0xs='
WHERE
key_id = '863de08098f5f3922942e42ede77addcaa38c04b670954481321aaef783bf719'
AND (
token = '/9+h1WwZ2pw23NZPSkNfOlqDrdfIoB2SDOKPj9XA0xs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)