UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '+CE9pyMiNKLMefM+UgtaDoNDNQXrhkdb5kziJg3fDhk='
WHERE
key_id = '21c8013a6791dab58063f1a76d38ad7d0bc8702e25d674e72bd3b75bd9eb7a2e'
AND (
token = '+CE9pyMiNKLMefM+UgtaDoNDNQXrhkdb5kziJg3fDhk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)