UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'dGB1jOJMTAZcZr1LDFEXWtxAnKdns4c1kDe2g3gD2L0='
WHERE
key_id = 'b66d0ef01619add88e5131bd366a0b71305a15f16c4402354cdee0bfa69f8d82'
AND (
token = 'dGB1jOJMTAZcZr1LDFEXWtxAnKdns4c1kDe2g3gD2L0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)