UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NvMBiVPKCJN9M1H74UdJ6Ke+8mD15oiVWw1fWf8H310='
WHERE
key_id = '7e4d68d9dcbe3f3e024aa09c2e50f53ef8b9345a86bfd120d42d6ba2f37341d4'
AND (
token = 'NvMBiVPKCJN9M1H74UdJ6Ke+8mD15oiVWw1fWf8H310='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)