UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'ZjiR6/eYmpzZATIw3kosMK4e6rcSKGW/tcJdAh9tQYU='
WHERE
key_id = '8a09d40bbeb6b11e63f98c5cc2869ea771a452eafff9e66db2e1afcd6a844254'
AND (
token = 'ZjiR6/eYmpzZATIw3kosMK4e6rcSKGW/tcJdAh9tQYU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)