UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'vH7zSybGaMnqfIt91kBAb+ku+otxJWTZ0gqOETan6qA='
WHERE
key_id = '4c9567df58d9813043944da1a13f144ee3f2452aea1907d4f2d852eaea10ef18'
AND (
token = 'vH7zSybGaMnqfIt91kBAb+ku+otxJWTZ0gqOETan6qA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)