UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'xOd1F5CnkEknBuGoYQG9PKHXBAMWkmUzR9HAiM86oeA='
WHERE
key_id = '4a65104e2a73e75fcde94f3264c180e27711a22f6f39361878a0600907f51654'
AND (
token = 'xOd1F5CnkEknBuGoYQG9PKHXBAMWkmUzR9HAiM86oeA='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)