UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5AoUABRwG2/tMBPWHDTuOuCihjrYbkoGlZMoeEgR9bI='
WHERE
key_id = '4dcfa38088b117ccc27d5f82c8f6b63dbb99680c100d14dd9559668b717f6057'
AND (
token = '5AoUABRwG2/tMBPWHDTuOuCihjrYbkoGlZMoeEgR9bI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)