UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'iPzHxhnU2Qg0VWwSO9drwHfpDXcMdrRGEewgOtUtXGk='
WHERE
key_id = '7ea1cf475a51c958137c4389e034456981bfc48326fbda50ae797fb981e9b590'
AND (
token = 'iPzHxhnU2Qg0VWwSO9drwHfpDXcMdrRGEewgOtUtXGk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)