UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xKB04qUfHBS8qdOGyV6Rr/ei1l58t1qDeWABD/1fyig='
WHERE
key_id = '11cb73470cf96b0fc71058073997aa337ccb596fcbaa8cfd8abe7906d0f6699d'
AND (
token = 'xKB04qUfHBS8qdOGyV6Rr/ei1l58t1qDeWABD/1fyig='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)