UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WSg0M3bcPzeTjYDKQQ+UDUisPvOmTCFcAQIEnON5SBk='
WHERE
key_id = '08beaf9353ad5b8cc67b11ff805e44329b4b0b6210a111639ac8d60d0169c2ec'
AND (
token = 'WSg0M3bcPzeTjYDKQQ+UDUisPvOmTCFcAQIEnON5SBk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)